<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org"
	xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<link th:href="@{/ajax/libs/jquery-layout/jquery.layout-latest.css}" rel="stylesheet"/>
<link th:href="@{/ajax/libs/jquery-ztree/3.5/css/metro/zTreeStyle.css}" rel="stylesheet"/>

<body class="gray-bg">

	
	<div class="container-div ui-layout-center">
		<div class="row">
			<div class="col-sm-12 select-info">
				<form id="user-form">
					<input type="hidden" id="deptId" name="deptId">
	                <input type="hidden" id="parentId" name="parentId">
					<div class="select-list">
						<ul>
							<li>
								登录名称：<input type="text" name="createBy"/>
							</li>
							
							<li>
								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
							    <a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()" shiro:hasPermission="system:label:export"><i class="fa fa-download"></i>&nbsp;导出标签化结果Excel</a>
								<a class="btn btn-success btn-rounded btn-sm" href="/system/label/exportData" shiro:hasPermission="system:label:export"><i class="fa fa-download"></i>&nbsp;导出标签化结果数据</a>
							</li>
						</ul>
					</div>
				</form>
			</div>
			

	        
	        <div class="col-sm-12 select-table table-striped">
			    <table id="bootstrap-table" data-mobile-responsive="true"></table>
			</div>
		</div>
	</div>
	<div th:include="include :: footer"></div>
	<script th:src="@{/ajax/libs/jquery-layout/jquery.layout-latest.js}"></script>
	<script th:src="@{/ajax/libs/jquery-ztree/3.5/js/jquery.ztree.all-3.5.js}"></script>
	<script th:inline="javascript">
		var editFlag = [[${@permission.hasPermi('system:label:edit')}]];
		var prefix = ctx + "system/label"

		$(function() {
			$('body').layout({ west__size: 185 });
			queryLabelList();
		});

		function queryLabelList() {
		    var options = {
		        url: prefix + "/list",
		        updateUrl: prefix + "/edit/{id}",
		        exportUrl: prefix + "/export",
		        sortName: "t1.update_time",
		        sortOrder: "desc",
		        modalName: "标签",
		        search: false,
		        showExport: false,
		        columns: [{
		            checkbox: true
		        },
		        {
		            field: 'create_by',
		            title: '创建者'
		        },
		        {
		            field: 'thumbnail_path',
		            title: '图片',
		            formatter: function(value, row, index) {
		                var actions = [];
		                actions.push("<img src='/"+row.thumbnail_path+"'/>");
		                return actions.join('');
		            }
		        },
		        {
		            field: 'picture_label',
		            title: '图片标签'
		        },
		        {
		            field: 'update_by',
		            title: '最后修改',
		        },
		        {
		            field: 'update_time',
		            title: '最后修改时间',
		            sortable: true
		        },
		        {
		            title: '操作',
		            align: 'center',
		            formatter: function(value, row, index) {
		                var actions = [];
		                actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.user_id + '/'+row.picture_id+'\')"><i class="fa fa-edit"></i>编辑</a> ');
		                return actions.join('');
		            }
		        }]
		    };
		    $.table.init(options);
		}

	</script>
</body>
</html>